<template>
  <div class="loading">
    <!-- <h1>加载页面</h1> -->
    <div class="loading_text">自律拥抱生活</div>
    <!-- 动画 -->
    <div class="myAnimation">
      <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
      </ul>
    </div>
    <!-- 底部 -->
    <div class="loading_footer">
      <div class="imgBox">
        <img src="../assets/images/sport.png" alt="S~" />
      </div>
      <div class="pBox">sport</div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
* {
  list-style: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@keyframes loading {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.3);
  }

  100% {
    transform: scale(1);
  }
}

.loading {
  width: 100vw;
  height: 100vh;
  background: #061439;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;

  // 文本
  .loading_text {
    font-size: 32px;
    font-weight: 700;
    font-style: italic;
    text-align: center;
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 270px;
    // background: aqua;
  }

  // 动画
  .myAnimation {
    width: 120px;
    height: 60px;
    // background: aqua;
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: -60px;

    ul {
      width: 100%;
      height: 60px;
      //   background: gray;
      display: flex;
      justify-content: space-evenly;
      align-items: center;

      li {
        width: 5px;
        height: 60px;
        background: red;
        // border-radius: 30px;

        &:nth-child(1) {
          animation: loading 1.2s linear 0.2s infinite;
        }

        &:nth-child(1) {
          animation: loading 1.2s linear 0.2s infinite;
        }

        &:nth-child(2) {
          animation: loading 1s linear 0.2s infinite;
        }

        &:nth-child(3) {
          animation: loading 1s linear 0.4s infinite;
        }

        &:nth-child(4) {
          animation: loading 1s linear 0.6s infinite;
        }

        &:nth-child(5) {
          animation: loading 1s linear 0.8s infinite;
        }

        &:nth-child(6) {
          animation: loading 1s linear 1s infinite;
        }
      }
    }
  }

  // 底部
  .loading_footer {
    width: 300px;
    height: 70px;
    // background: yellow;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, -50%);

    .imgBox {
      width: 50px;
      height: 50px;
      background: white;
      border-radius: 10px;
      display: flex;
      justify-content: center;
      align-items: center;

      img {
        width: 30px;
        vertical-align: bottom;
      }
    }

    .pBox {
      font-size: 27px;
      margin-left: 15px;
    }
  }
}
</style>

<script lang="ts">
import { Vue } from "vue-class-component";

export default class LoadingView extends Vue {}
</script>
